package com.bailian.web.controller.test;

import com.bailian.common.annotation.Anonymous;
import com.bailian.common.core.controller.BaseController;
import com.bailian.common.core.domain.AjaxResult;
import com.bailian.system.domain.vo.BlParkVo;
import com.bailian.system.service.IBlParkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test/park")
public class ParkTestController extends BaseController {
    
    @Autowired
    private IBlParkService parkService;
    
    @Anonymous
    @GetMapping("/{id}")
    public AjaxResult getPark(@PathVariable Long id) {
        try {
            BlParkVo park = parkService.selectById(id);
            if (park == null) {
                return error("园区不存在");
            }
            return success(park);
        } catch (Exception e) {
            return error("获取园区详情失败：" + e.getMessage());
        }
    }
}
